Bitcoin Forum
May 09, 2024, 04:57:46 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Sending alerts in the testnet-in-a-box  (Read 1321 times)
fbueller (OP)
Sr. Member
****
Offline Offline

Activity: 412
Merit: 275


View Profile
October 28, 2013, 05:00:48 PM
 #1

I know the testnet gets periodic alerts but I wanted to do it myself to check how my software will react. Is there any scripts which will do this?

I'm sure others have a similar interest.. I'm also just curious about how to do this, I know for the main bitcoin network Satoshi, theymos and Gavin have they key, but how do we do this using our own testnet?

Bitwasp Developer.
1715230666
Hero Member
*
Offline Offline

Posts: 1715230666

View Profile Personal Message (Offline)

Ignore
1715230666
Reply with quote  #2

1715230666
Report to moderator
1715230666
Hero Member
*
Offline Offline

Posts: 1715230666

View Profile Personal Message (Offline)

Ignore
1715230666
Reply with quote  #2

1715230666
Report to moderator
1715230666
Hero Member
*
Offline Offline

Posts: 1715230666

View Profile Personal Message (Offline)

Ignore
1715230666
Reply with quote  #2

1715230666
Report to moderator
It is a common myth that Bitcoin is ruled by a majority of miners. This is not true. Bitcoin miners "vote" on the ordering of transactions, but that's all they do. They can't vote to change the network rules.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715230666
Hero Member
*
Offline Offline

Posts: 1715230666

View Profile Personal Message (Offline)

Ignore
1715230666
Reply with quote  #2

1715230666
Report to moderator
1715230666
Hero Member
*
Offline Offline

Posts: 1715230666

View Profile Personal Message (Offline)

Ignore
1715230666
Reply with quote  #2

1715230666
Report to moderator
gatra
Hero Member
*****
Offline Offline

Activity: 583
Merit: 505


CTO @ Flixxo, Riecoin dev


View Profile WWW
October 28, 2013, 06:25:21 PM
 #2

I found no code for generating alerts. In alert_tests.cpp, I found this:

// (SignAndSave code not shown, alert signing key is secret)

but I think that code for SignAndSave should be shown: they could share the code without sharing the private key, otherwise it feels like security by obscurity.
Currently we have to make our own code to generate alerts and test them. If we change the keys then the tests no longer work and can't be made to work without extra coding.


           ▄▄▄██████████▄▄▄
       ▄▄██
██████████████████▄▄
     ▄█
█████▀████████████▀██████▄
   ▄█
█████████████████████████████▄
  ▄█
█████████▄█▀▀██████████████████▄
 ▄█
███████████▀██████▄▄█████▄███████▄
▄█
██████████▀██▄▄▄▄██▀▀▀▀▀███████████▄
█████████████▀▀██▀████████▀▀████████
█████████████▄█▀████████████████████
████████▀▀▀▀██▀▀▀▀██████████████████
▀█
██████▀▀▀▀██▀▀▀▀███████████████████▀
 ▀█
███████▄████▄▄███████████████████▀
  ▀█
███████████████████████████████▀
   ▀█
█████████████████████████████▀
     ▀█
█████▄████████████▄██████▀
       ▀▀██
██████████████████▀▀
           ▀▀▀██████████▀▀▀
riecoin       ▄▄█████████▄▄
    ▄██▀▀         ▀▀██▄
  ▄██▀              ▀██▄
 ▄██     ██▄▄          ██▄
▄██      █████▄▄        ██▄
██       ████████▄▄      ██
██       ███████████▄    ██
██       ██████████▀     ██
▀██      ███████▀       ██▀
 ▀██     ████▀         ██▀
  ▀██▄   █▀          ▄██▀
    ▀██▄▄         ▄▄██▀
       ▀▀█████████▀▀
.flixxo   
fbueller (OP)
Sr. Member
****
Offline Offline

Activity: 412
Merit: 275


View Profile
October 29, 2013, 08:49:47 AM
 #3

Have you been successful? I'd be wary about altering the pubkey (after generating a private one) and recompiling. Obviously a testing environment should be as close to the real thing as possible. It working because of a fluky choice in key, would be a mess. We shouldn't have to modify code to get this working. Substituting a key I could live with, but right now excluding it feels wrong.

It should be included and adequately documented. Developers are given access to more features on a testnet, signing and sending alerts should be one of those things. Not just being told "you're not one of these 3 people, so youlll never have to look at this code" by omission.

If not the main testnet, it may as well be available for our own testnet in a box.

Bitwasp Developer.
deepceleron
Legendary
*
Offline Offline

Activity: 1512
Merit: 1032



View Profile WWW
October 29, 2013, 12:53:41 PM
 #4

I don't know that it's ever been done, but you could ask for a testnet alert to be set by a core dev if you are a client developer that wants to implement user presentation properly.
gatra
Hero Member
*****
Offline Offline

Activity: 583
Merit: 505


CTO @ Flixxo, Riecoin dev


View Profile WWW
October 29, 2013, 05:28:42 PM
 #5

I believe it's ok that the keys are kept secret, it would be a mess otherwise.
If you need to test, I can think of two options: comment out the validation (make CAlert::CheckSignature return always true) or use your own keys.
If you create new keys using CKey::MakeNewKey and then IsValid() there should be no such thing as "fluky keys"
But I guess that either way you'll have to code you own alert sending functions.
Asking a dev to generate an alert for you is a good idea but you can do it only once or twice, you can't rely on that for testing/debugging.
I'm working on an alt-coin so I generated new keys but I haven't written the code to actually test them yet... it shouldn't be hard: just create a CAlert manually and then make the client relay it to the other nodes (adding it to mapAlerts).


           ▄▄▄██████████▄▄▄
       ▄▄██
██████████████████▄▄
     ▄█
█████▀████████████▀██████▄
   ▄█
█████████████████████████████▄
  ▄█
█████████▄█▀▀██████████████████▄
 ▄█
███████████▀██████▄▄█████▄███████▄
▄█
██████████▀██▄▄▄▄██▀▀▀▀▀███████████▄
█████████████▀▀██▀████████▀▀████████
█████████████▄█▀████████████████████
████████▀▀▀▀██▀▀▀▀██████████████████
▀█
██████▀▀▀▀██▀▀▀▀███████████████████▀
 ▀█
███████▄████▄▄███████████████████▀
  ▀█
███████████████████████████████▀
   ▀█
█████████████████████████████▀
     ▀█
█████▄████████████▄██████▀
       ▀▀██
██████████████████▀▀
           ▀▀▀██████████▀▀▀
riecoin       ▄▄█████████▄▄
    ▄██▀▀         ▀▀██▄
  ▄██▀              ▀██▄
 ▄██     ██▄▄          ██▄
▄██      █████▄▄        ██▄
██       ████████▄▄      ██
██       ███████████▄    ██
██       ██████████▀     ██
▀██      ███████▀       ██▀
 ▀██     ████▀         ██▀
  ▀██▄   █▀          ▄██▀
    ▀██▄▄         ▄▄██▀
       ▀▀█████████▀▀
.flixxo   
gatra
Hero Member
*****
Offline Offline

Activity: 583
Merit: 505


CTO @ Flixxo, Riecoin dev


View Profile WWW
October 31, 2014, 07:01:56 PM
 #6

These may help:

https://gist.github.com/laanwj/0e689cfa37b52bcbbb44

https://gist.github.com/gavinandresen/1481736

The first one worked for me.


           ▄▄▄██████████▄▄▄
       ▄▄██
██████████████████▄▄
     ▄█
█████▀████████████▀██████▄
   ▄█
█████████████████████████████▄
  ▄█
█████████▄█▀▀██████████████████▄
 ▄█
███████████▀██████▄▄█████▄███████▄
▄█
██████████▀██▄▄▄▄██▀▀▀▀▀███████████▄
█████████████▀▀██▀████████▀▀████████
█████████████▄█▀████████████████████
████████▀▀▀▀██▀▀▀▀██████████████████
▀█
██████▀▀▀▀██▀▀▀▀███████████████████▀
 ▀█
███████▄████▄▄███████████████████▀
  ▀█
███████████████████████████████▀
   ▀█
█████████████████████████████▀
     ▀█
█████▄████████████▄██████▀
       ▀▀██
██████████████████▀▀
           ▀▀▀██████████▀▀▀
riecoin       ▄▄█████████▄▄
    ▄██▀▀         ▀▀██▄
  ▄██▀              ▀██▄
 ▄██     ██▄▄          ██▄
▄██      █████▄▄        ██▄
██       ████████▄▄      ██
██       ███████████▄    ██
██       ██████████▀     ██
▀██      ███████▀       ██▀
 ▀██     ████▀         ██▀
  ▀██▄   █▀          ▄██▀
    ▀██▄▄         ▄▄██▀
       ▀▀█████████▀▀
.flixxo   
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!