wormhole-foundation / wormhole-scaffolding

Starter apps with Wormhole integration
Other
49 stars 33 forks source link

Relayer: add simple relayer #56

Closed barnjamin closed 1 year ago

barnjamin commented 1 year ago

I need to have easily runnable examples for simple message passing.

Since we already have the contracts here, I'm just borrowing the generated typescript clients to implement a relayer for the deployed examples.

$ yarn run doit
Deploying contract for solana
Deploying contract for ethereum
0xdC78afe9cFDe0576Ff236667DC8c380615c24Ca9
All contracts deployed, registering emitters
Registering d73a91ab79def458a725cc313fea4f81f130fc074a352d960cae3b826986a767 for solana on ethereum
1 d73a91ab79def458a725cc313fea4f81f130fc074a352d960cae3b826986a767
Registering 000000000000000000000000dc78afe9cfde0576ff236667dc8c380615c24ca9 for ethereum on solana
Registered �x����v�#fg܌8�L� for chain 2
Finished deployment an initialization
Sent a message, which was assigned the sequence id of: 1
Got VAA:  {
  version: 1,
  guardianSetIndex: 0,
  guardianSignatures: [
    {
      index: 0,
      signature: <Buffer 27 53 2b 81 49 e8 6a f4 b3 f5 63 48 89 dd 21 a7 9f 5b 28 ec e1 2a 06 ea 3d ed 55 4b da 60 21 52 3c 3b 1d 2a 23 e9 55 93 f6 fe 52 dd 79 f9 11 71 0f 96 ... 15 more bytes>
    }
  ],
  timestamp: 0,
  nonce: 0,
  emitterChain: 1,
  emitterAddress: <Buffer d7 3a 91 ab 79 de f4 58 a7 25 cc 31 3f ea 4f 81 f1 30 fc 07 4a 35 2d 96 0c ae 3b 82 69 86 a7 67>,
  sequence: 2n,
  consistencyLevel: 1,
  payload: <Buffer 01 00 0b 48 65 6c 6c 6f 20 57 6f 72 6c 64>,
  hash: <Buffer 47 68 92 67 e0 53 16 e1 a8 1a 5e 4f 4b 2d ce 33 12 ea 17 06 50 be b5 90 66 26 7c 6d 9c 94 3e a5>
}
Received Hello World in the destination contract
Done in 26.37s.

TODO: