cruzawl 1.0.9+9 copy "cruzawl: ^1.0.9+9" to clipboard
cruzawl: ^1.0.9+9 copied to clipboard

Library for the CRUZ cryptocurrency and the cruzbit.1 network.

example/example.dart

// Copyright 2019 cruzawl developers
// Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.

import 'dart:io';

import 'package:cruzawl/currency.dart';
import 'package:cruzawl/network.dart';
import 'package:cruzawl/preferences.dart';

// bash-3.2$ dart example.dart
// *** Latest Block ***
// Height: 19527
void main() {
  PeerNetwork network = cruz.createNetwork();

  /// Print the latest [BlockHeader] in the block chain.
  network.tipChanged = () {
    print('*** Latest Block ***');
    print('Height: ${network.tipHeight}');
    exit(0);
  };

  /// Connect [PeerNetwork] to public seeder.
  network
      .addPeer(network.createPeerWithSpec(
          PeerPreference('SatoshiLocomoco', 'wallet.cruzbit.xyz', 'CRUZ', '',
              debugPrint: (x) {/* print('DEBUG: $x'); */})))
      .connect();
}
0
likes
40
pub points
0%
popularity

Publisher

unverified uploader

Library for the CRUZ cryptocurrency and the cruzbit.1 network.

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

bip39, collection, convert, ed25519_hd_key, fixnum, json_annotation, meta, pedantic, pointycastle, sembast, tweetnacl

More

Packages that depend on cruzawl