monorepo
monorepo copied to clipboard
Pepecoin Issue
CHAIN
and NETWORK
in .env
have no effect so I am starting the node with:
./scripts/up.py --testnet --pepecoin
When starting the node, the following error is logged:
bcn-1 | 09-07-2024 07:44:55 error Wallet creation failed with error 'Method not found'
Then as the node syncs the console is spammed with the following error for every transaction:
sync-1 | 09-07-2024 13:07:39 error [wid 1 pid: 29: failed to parse transaction in block 43333
sync-1 | error message: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined
sync-1 | transaction: {"txid":"5b96393413bcabd197e0edc6aabc76968767e6c8450c615057635b243891bdaa","hash":"5b96393413bcabd197e0edc6aabc76968767e6c8450c615057635b243891bdaa","size":89,"vsize":89,"version":1,"locktime":0,"vin":[{"coinbase":"0345a900","sequence":4294967295}],"vout":[{"value":500000,"n":0,"scriptPubKey":{"asm":"OP_DUP OP_HASH160 2e75729ad22574fe62ac8c8856c7a2e5ae26ecf2 OP_EQUALVERIFY OP_CHECKSIG","hex":"76a9142e75729ad22574fe62ac8c8856c7a2e5ae26ecf288ac","reqSigs":1,"type":"pubkeyhash","addresses":["nYRp3W82vFNJerdT3kqzKFM5zVXW8nYowj"]}}]}
-
Running the following html after the node has synced, the wallet balance shows 0 in the console even though the address has 200 PEPE on the blockchain. This is most likely due to the error above.
-
If I send an additional 100 PEPE to the address and reload the page it will show balance 100 PEPE (the amount sent after the node has started, not total) but will remain unconfirmed forever even thought it would become confirmed on the blockchain. Most likely also related to the above.
After getting it to show a (unconfirmed) balance I uncomment the lines to mint and update and the script appears to work but the transaction is never broadcast to the other nodes. The transaction get stuck in the local mempool and never makes it onto the blockchain, so the transaction must be invalid somehow, this I think is unrelated to the above errors, it might be using an address type incompatible with Pepecoin when creating the transaction? I'm not sure.
index.html (click to expand)
<html>
<head>
<script type='module'>
// Import the Bitcoin Computer library
//import { Computer, Contract } from "https://unpkg.com/@bitcoin-computer/lib/dist/bc-lib.browser.min.mjs"
import { Computer, Contract } from './bc-lib.browser.min.mjs';
// Define a smart contract
class Counter extends Contract {
constructor() {
super({ n: 0 })
}
inc() {
this.n += 1
}
};
// Initialize smart contract wallet
const computer = new Computer({
chain: 'PEPE',
network: 'testnet',
// left some test PEPE in there (nUFSJ3jNS5Ksnm3WiR7jvTgdW65zpdWr5j)
mnemonic: 'leopard wrestle patient tent peasant company half tool galaxy flight supreme spy',
addressType: 'p2pkh',
path: "m/44'/0'/0'/0",
url: 'http://computer.pepeblocks.com:1031',
moduleStorageType: 'multisig',
satPerByte: 1000
});
console.log('Address: ' + computer.getAddress());
console.log('Balance: ' + JSON.stringify(await computer.getBalance()));
// Mint a new on-chain object
//const counter = await computer.new(Counter);
//document.getElementById("count").innerHTML = counter.n;
// Update the on-chain object
//await counter.inc();
//document.getElementById("count").innerHTML = counter.n;
</script>
</head>
<body>
Value: <span id='count'>*</span>
</body>
</html>
If you want try to make this work there is a testnet explorer here: https://testnet-blockbook.pepeblocks.com/address/nUFSJ3jNS5Ksnm3WiR7jvTgdW65zpdWr5j or here: https://testnet.pepeblocks.com/